declare
proc {UserStep I}
   U=Users.I
   % Ask three users for their performance information
   L={List.map [{UniformI 1 M} {UniformI 1 M} {UniformI 1 M}]
       fun {$ X}
          (Users.X.currentSite) #
          Sites.(Users.X.currentSite).performance
             + {Gauss}*{IntToFloat N}
       end}
   % Calculate the best site
   MS#MP = {List.foldL L
            fun {$ X1 X2} if X2.2>X1.2 then X2 else X1 end end
            U.currentSite #
            Sites.(U.currentSite).performance
               + {Abs {Gauss}*{IntToFloat N}}}
in
   if MS\=U.currentSite then
      Sites.(U.currentSite).hits :=
         Sites.(U.currentSite).hits - 1
      U.currentSite := MS
      Sites.MS.hits := Sites.MS.hits + 1
   end
end
